package com.ysdcrm.crm.mapper;

import java.util.List;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ysdcrm.crm.model.Customers;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ICustomerMapper extends BaseMapper<Customers>{
    @Select("select * from customers where recorder = #{uid}")
    List<Customers> findByRecorder(int uid);//网络查询师查询自己录入的客户信息

    @Select("select * from customers where consultant = #{uid}")
    List<Customers> findByConsultant(int uid);//咨询师查询分配给自己的客户信息

    @Update("update customers set status = 0 where cid = #{cid}")
    int del(int cid);

    @Update("update customers set consultant = #{newConsultant} where consultant = #{oldConsultant}")
    int changeConsultant(int oldConsultant,int newConsultant);//批量修改客户归属的咨询师

}
